<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<%@include file="/WEB-INF/jsp/hadmin/contentHeader.jsp"%>
</head>
<body class="gray-bg">
	<div class="row wrapper border-bottom white-bg page-heading">
		<div class="col-sm-12">
			<h:tableButton>
				<div class="col-md-4">
					<input placeholder="ID" class="form-control" type="text"
						name="nickName">
				</div>
			</h:tableButton>
			<h:table excludeAll="true">
				<th data-sortable="true" data-field="nickName">ID</th>
				<th data-sortable="true" data-field="name">姓名</th>
				<th data-sortable="true" data-field="sex">性别</th>
				<th data-sortable="true" data-field="organization__name">组织</th>
				<th data-sortable="true" data-formatter="roleFormatter" data-field="roleSet">角色</th>
			</h:table>
			<%-- <%@include file="/WEB-INF/jsp/hadmin/include/table.jsp" %> --%>
		</div>
	</div>

	<script type="text/javascript">
		var tableConfig = {
			uniqueId : "nickName",
		};
		
		function roleFormatter(argu) {
			if(!argu){
   				return "";
   			}
			var roleName ="";
    		for(var i = 0;i<argu.length;i++){
    			//console.log(argu[i].name);
    			if(i!=0){
    				roleName+=",";
    			}
    			roleName += argu[i].name;
    		} 
    		if(roleName.length>75){
    			roleName = roleName.substring(0,75) +"...";
    		}
			return roleName;
		}
	</script>
	<h:configBootstrapTable />
	<%-- <%@include file="/WEB-INF/jsp/hadmin/include/tableInit.jsp" %> --%>
</body>

</html>
